<?php

/*
	info: 是否可以更换预定
*/

define('IS_MEMBER_CHECK', TRUE);
require '../common.inc.php';

$webglobal['CPP']['id'] = api_GetTopActivityID();

$return['code'] = 0;
$return['data']['ischange'] = true;
$webglobal['datainfo'] = $db->GetOne("SELECT U.sid,U.peoplenum,U.codetime,S.* FROM promotion_user U LEFT JOIN promotion_site S ON (U.sid=S.id) WHERE U.uid='{$user['m_uid']}' AND U.pid='{$webglobal['CPP']['id']}'");
if (!empty($webglobal['datainfo']))
{
	if ($webglobal['datainfo']['peoplenum']>0 && !empty($webglobal['datainfo']['id']) && $webglobal['datainfo']['begintime']-$webserver['timestamp']<$webglobal['lastedittime'])
	{
		$return['data']['ischange'] = false;
	}
}
api_EchoReturn();
